import React from 'react';
import ReactDOM from 'react-dom';
import { Route, Link } from 'react-router-dom';
import { Provider } from 'react-redux';
import Home from './components/Home';
import Counter from './components/Counter';
import store from './store';
import { ConnectedRouter } from 'connected-react-router';
import history from './history';
ReactDOM.render(
  <Provider store={store}>
    <ConnectedRouter history={history}>
      <Route path="/" exact component={Home} />
      <Route path="/counter" exact component={Counter} />
    </ConnectedRouter>
  </Provider>, document.getElementById('root')
);

/**
 * HashRouter 和 BrowserRouter 内部调用的都是react-router库里的Router, 只不过分别传入不同的history对象
 *
 * 而如果你要使用 connected-react-router, 你需要使用它提供的 <ConnectedRouter/>, 并且必须提供 <Provider store={store}>
 * */
